<script setup lang="ts">
import axios from "axios";
import { ref } from "vue";
type ChannelList = {
  id: number;
  name: string;
}[];

type ChannelRs = {
  data: {
    channels: ChannelList;
  };
  message: string;
};
const list = ref<ChannelList>([]);
async function getChannel() {
  const res = await axios.get<ChannelRs>(
    "http://geek.itheima.net/v1_0/channels"
  );
  list.value = res.data.data.channels;
}
getChannel();
</script>

<template></template>

<style scoped></style>
